package com.entity;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

public class OrderList {

    private Map<Class<? extends Product>, BigDecimal> list = new HashMap<>();

    public void add(Class<? extends Product> clazz, BigDecimal count) {
        if (list.containsKey(clazz)) {
            list.put(clazz, list.get(clazz).add(count));
        } else {
            list.put(clazz, count);
        }
    }

    public Map<Class<? extends Product>, BigDecimal> getList() {
        return list;
    }
}
